﻿Public Class clsLhCkMes
    Public Function insert(oper_type As String, pgdMesSysId As String, oper_num As String, prod_id As String, oper As String, workshop_id As String, mes_sync_result As String) As Integer
        Dim sql As String = ""
        Dim rtn As Integer
        DBacs.BeginTransaction()
        Try
            Dim opn As Integer = Integer.Parse(Double.Parse(oper_num))
            sql &= "INSERT INTO sf.b_lh_ck_mes(oper_type, b_pgd_mes_sys_id,oper_num, operator, update_time,prod_id,workshop_id,mes_sync_result)  "
            sql &= "VALUES ( ?, ?, ?, ?, (SELECT CURRENT_TIMESTAMP(6)), ?, ?, ?)"
            rtn = DBacs.ExecuteUpdateSql(sql, -1， oper_type, pgdMesSysId, opn, oper, prod_id, workshop_id, mes_sync_result)
            'sql = ""
            'sql &= "UPDATE sf.b_pgd_mes SET finish_count = ? WHERE sys_id = ? "
            'rtn = DBacs.ExecuteUpdateSql(sql, -1, oper_num, pgdMesSysId)
            DBacs.CommitTransaction()
        Catch ex As Exception
            DBacs.RollbackTransaction()
            rtn = -2
        End Try
        Return rtn
    End Function
End Class
